package com.neusoft.controller;

import com.neusoft.entity.Admin;
import com.neusoft.entity.AdminQuery;
import com.neusoft.service.AdminFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("admin/feign")
public class AdminConsumerFeignController {
    @Autowired
    private AdminFeignService adminFeignService;

    @GetMapping("getById/{id}")
    public Admin getById(@PathVariable Integer id) {
        return adminFeignService.getById(id);
    }
    @PostMapping("login")
    public Admin login(@RequestBody String account,@RequestParam("password") String password){
        return adminFeignService.login(account, password);
    }
    @PostMapping("queryAll")
    public Object queryAll(@RequestParam("page") Integer page, @RequestParam("limit") Integer limit, @RequestBody AdminQuery bean){
        return adminFeignService.queryAll(page,limit,bean);
    }
/*
    @PostMapping("save")
    public Object save(Admin bean){
        return adminFeignService.save(bean);
    }

    @DeleteMapping("{ids}")
    public  boolean deleteById(Integer[] ids){
        return adminFeignService.deleteById(ids);
    }*/
}
